<my-pageheader></my-pageheader>

<div style="margin: 20px 20px 50px 20px">
    <mat-card style="margin-top: 20px; background-color: #f0f0f0">
        <span style="font-weight: bold; font-size: 28px">{{userLogin}} 的积分</span>
    </mat-card>
    <mat-card *ngIf="credit">
        <h4>现有积分： {{credit.credit}}</h4>
        人为增减积分：
        &nbsp;&nbsp;&nbsp;
        <mat-form-field>
            <input matInput [(ngModel)]="creditPlus" type="number" placeholder="增减积分值">
        </mat-form-field>
        &nbsp;&nbsp;&nbsp;
        <button mat-raised-button color="primary" (click)="addCredit()">
            提交
        </button>
    </mat-card>
    <mat-card *ngIf="creditHistoryList">
        <h4>积分操作历史： </h4>
        <br>
        <div *ngFor="let creditHistory of creditHistoryList">
            <mat-card style="margin:0">
                <p>
                    <span><i class="fa fa-fw fa-credit-card"></i></span>
                    {{creditHistory.modifyDate | date:'yyyy-MM-dd HH:mm:ss'}}： &nbsp;&nbsp;&nbsp;
                    {{creditHistory.comment}}， &nbsp;&nbsp;&nbsp;
                    <span *ngIf="creditHistory.creditPlus > 0">+</span>
                    {{creditHistory.creditPlus}}积分，&nbsp;&nbsp;&nbsp;
                    当前积分：{{creditHistory.currentCredit}}
                </p>
            </mat-card>
        </div>
    </mat-card>

</div>


